<?php
$vanAllesWat = array('banaan' => array( 'soort' => 'fruit', 'kleur' => 'geel', 'vorm' => 'halve maan', 'vitaminec' => 9)
			,'bloemkool'	=> array( 'soort' => 'groente', 'kleur' => 'groen|geel', 'vorm' => 'rond', 'vitaminec' => 50)
			, 'appel' => array('soort' => 'fruit', 'kleur' => 'rood|geel', 'vorm' => 'rond', 'ras' => 'elstar', 'vitaminec' => 5)
			, 'aardbei' => array('soort' => 'fruit', 'kleur' => 'rood', 'vorm' => 'rond' , 'vitaminec' => 56)
			, 'spinazie' => array('soort' => 'groente', 'kleur' => 'groen', 'vorm' => 'plat', 'vitaminec' => 17)
			, 'ananas' => array('soort' => 'fruit', 'kleur' => 'geel', 'vorm' => 'ovaal', 'vitaminec' => 15)
			, 'wortel' => array('soort' => 'groente', 'kleur' => 'oranje', 'vorm' => 'langwerpig', 'vitaminec' => 9)
			, 'andijvie' => array('soort' => 'groente', 'kleur' => 'groen', 'vorm' => 'ovaal', 'vitaminec' => 6)
			);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Eindtoets</title>
<link href="../data/css/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="main_bg"><img src="../data/images/main_bg.jpg" alt="main bg" /></div>

<div id="wrapper">
	<!-- header -->
    	<div id="header">
        	<div id="left_bow"></div>
            	<div class="placer">
                	<div id="logo"><img src="../data/images/logo.png" alt="logo" /></div>
                </div>
            <div id="right_bow"></div>
        </div>
        
        <?php include 'menu.php'; ?>
        
        <!-- content -->
    <div id="content">
        <div class="placer">
        	<!-- col left -->
        	<div id="col_left">
                <div class="field">
                    <div class="bg_top"></div>
                    <div class="bg_mid">
                        <h2>Opdracht 1.1</h2>
                        <p><?php
							foreach($vanAllesWat as $key => $fruit){
								if($fruit[soort] == 'fruit'){
									
									$vitamine_fruit[] = $fruit[vitaminec];
									
								}
								
								$max_fruit = max($vitamine_fruit);
								
								
								
								
								if($fruit[soort] == 'groente'){
									$vitamine_groente[] = $fruit[vitaminec];
								}
								$max_groente = max($vitamine_groente);
							}
							
							foreach($vanAllesWat as $key => $fruit){
								if(in_array($max_fruit, $fruit)){
									$fruit_naam = $key;	
								}
								
								if(in_array($max_groente, $fruit)){
									$groente_naam = $key;	
								}
							}
							
								
							echo 'Meeste vitamine zitten in '.$fruit_naam.' namelijk: '.max($vitamine_fruit).'<br />';
							echo 'Meeste vitamine zitten in '.$groente_naam.' namelijk: '.max($vitamine_groente);
						 ?></p>
                         
                         <h2>Opdracht 1.2</h2>
                         <p><?php
						 	foreach($vanAllesWat as $key => $fruit){
								$kleur[] = $fruit[kleur];
								
							}
							
							$meest = array_count_values($kleur);
							$meest_nr =  max($meest);
							foreach($meest as $key => $val){
								if($val == $meest_nr){
									echo 'De kleur: '.$key.' zijn er: '.$val.'<br />';	
								}
							}
						 ?></p>
                         
                         <h2>Opdracht 1.3</h2>
                         <p><?php
						 	foreach($vanAllesWat as $key => $vitamine){
								if($vitamine[soort] == 'groente'){
									$vit[] = $vitamine[vitaminec];
								}
							}
							foreach($vit as $val){
								$total = $total + $val;
								$nr = $nr + 1;
							}
							echo 'Het gemiddelde aantal vitamine c in groente is: '.$total / $nr;
						 ?></p>
                         
                         <h2>Opdracht 1.4</h2>
                         <p><?php
						 	foreach($vanAllesWat as $key => $fruiten){
								foreach($fruiten as  $val){
									if($val == 'rond' or $val == 'geel'){
										echo $key.'<br />';
									}
									
									
									
								}
							}
							
						 ?></p>
                    </div>
                    <div class="bg_bottom"></div>
              </div>
          </div>
          <!-- end col left -->
          
          <!-- col right -->
        	<div id="col_right">
                <div class="field">
                    <div class="bg_top"></div>
                    <div class="bg_mid">         
                        <h2 class="sec">Mijn projecten</h2>
                        <ul>
                        	<li><a href="http://tim-design.nl" target="_blank">HoeWasMijnVakantie.nl</a></li>
                            <li><a href="http://manitavoetverzorging.nl" target="_blank">Manitavoetverzorging.nl</a></li>
                            <li><a href="http://min40celsius.nl" target="_blank">Min40celsius.nl</a></li>
                            <li><a href="http://heurnsmannenkoor.nl" target="_blank">Heurnsmannenkoor.nl</a></li>
                            <li><a href="http://mytraintravels.com" target="_blank">Mytraintravels.com (in ontwikkeling)</a></li>
                            <li><a href="http://sitevisie.nl" target="_blank">Sitevisie.nl (in ontwikkeling)</a></li>
                        </ul>
                    </div>
                    <div class="bg_bottom"></div>
              </div>
          </div>
          <!-- end col right -->
        </div>
    </div>
    <!-- end content -->
</div>
</body>
</html>